GBML manual / Backgrounds

perspective_floor

Turns the room’s zoomable background into a floor that runs away to a horizon, the way a racing game draws its road, or back into the flat picture.

Game Boy: not available

Game Boy Color: not available

Sega Genesis: not built yet - The Sega Genesis will draw the road its own way.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

perspective_floor(on)

Arguments

NameType
onbool

Returns

Nothing.

Description

Turns the room's zoomable background into a perspective floor: a floor that runs away to a horizon, the way a racing game draws its road. Called with false it is the flat picture again, with the position, scale and turn it had. It does nothing in a room that has no zoomable background.

While it is on, the picture is drawn from a camera standing over it. Set where the camera is with perspective_floor_camera, how high with perspective_floor_height, where the floor starts on the screen with perspective_floor_horizon and how wide it looks with perspective_floor_view. zoom_background_scale, zoom_background_rotation and zoom_background_focus wait while it is on and work again when it is turned off.

It is called from code, for example the Create event of the object that runs the race: there is no room setting. Keep the picture from repeating (zoom_background_repeat off, which is how it starts): the rows above the horizon are the picture's transparent edge, and that is how the room's other pictures show through there.

Example

// Create event of the object that runs the race.
perspective_floor(true);
perspective_floor_horizon(60);

The room's zoomable background becomes a road that runs to a horizon 60 rows down from the top of the screen. Above that row the room's own pictures (a skyline, say) show as they always do.

On the GBA

A no-op in a room that has no zoomable background. While it is on, the picture is drawn from a camera standing over it: set where with perspective_floor_camera, how high with perspective_floor_height, where the floor meets the sky with perspective_floor_horizon and how wide it looks with perspective_floor_view. zoom_background_scale, zoom_background_rotation and zoom_background_focus wait while it is on and take effect again when it is turned off. It is started by code (for example the Create event of the object that runs the race): there is no room setting. The picture should not repeat (zoom_background_repeat off, the default): the rows above the horizon are the picture’s transparent edge, so the room’s other pictures show through there.

See also: Perspective floorperspective_floor_cameraperspective_floor_heightperspective_floor_horizonperspective_floor_viewperspective_floor_projectZoomable backgrounds